package edu.sctu.java.builder;

import lombok.Data;

@Data
public class User {

    // required
    private String username;

    // optional
    private String password;
    // optional
    private String gender;

    private User() {

    }

    public static class Builder implements IBuilder<User> {

        private User user;

        public Builder() {
            this.user = new User();
        }

        public Builder password(String password) {
            this.user.setPassword(password);
            return this;
        }

        public Builder username(String username){
            this.user.setUsername(username);
            return this;
        }
        public Builder gender(String gender) {
            this.user.setGender(gender);
            return this;
        }

        @Override
        public User build() {
            return this.user;
        }
    }
}
